home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / grub.d / 00_header next >
Text File  |  2009-10-23  |  3KB  |  121 lines

  1. #! /bin/sh -e
  2.  
  3. # grub-mkconfig helper script.
  4. # Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
  5. #
  6. # GRUB is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GRUB is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. transform="s,x,x,"
  20.  
  21. prefix=/usr
  22. exec_prefix=${prefix}
  23. libdir=${exec_prefix}/lib
  24. grub_prefix=`echo /boot/grub | sed ${transform}`
  25.  
  26. . ${libdir}/grub/grub-mkconfig_lib
  27.  
  28. # Do this as early as possible, since other commands might depend on it.
  29. # (e.g. the `loadfont' command might need lvm or raid modules)
  30. for i in ${GRUB_PRELOAD_MODULES} ; do
  31.   echo "insmod $i"
  32. done
  33.  
  34. if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
  35. if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi
  36. if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
  37. if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
  38.  
  39. cat << EOF
  40. if [ -s /boot/grub/grubenv ]; then
  41.   have_grubenv=true
  42.   load_env
  43. fi
  44. set default="${GRUB_DEFAULT}"
  45. if [ \${prev_saved_entry} ]; then
  46.   saved_entry=\${prev_saved_entry}
  47.   save_env saved_entry
  48.   prev_saved_entry=
  49.   save_env prev_saved_entry
  50. fi
  51. EOF
  52.  
  53. case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
  54.   serial:* | *:serial)
  55.     if ! test -e ${grub_prefix}/serial.mod ; then
  56.       echo "Serial terminal not available on this platform." >&2 ; exit 1
  57.     fi
  58.  
  59.     if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
  60.       grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used."
  61.       GRUB_SERIAL_COMMAND=serial
  62.     fi
  63.     echo "${GRUB_SERIAL_COMMAND}"
  64.   ;;
  65. esac
  66.  
  67. case x${GRUB_TERMINAL_INPUT} in
  68.   x)
  69.     # Just use the native terminal
  70.   ;;
  71.   x*)
  72.     cat << EOF
  73. if terminal_input ${GRUB_TERMINAL_INPUT} ; then true ; else
  74.   # For backward compatibility with versions of terminal.mod that don't
  75.   # understand terminal_input
  76.   terminal ${GRUB_TERMINAL_INPUT}
  77. fi
  78. EOF
  79.   ;;
  80. esac
  81.  
  82. case x${GRUB_TERMINAL_OUTPUT} in
  83.  xgfxterm)
  84.     # Make the font accessible
  85.     prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}`
  86.  
  87.     cat << EOF
  88. if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
  89.   set gfxmode=${GRUB_GFXMODE}
  90.   insmod gfxterm
  91.   insmod ${GRUB_VIDEO_BACKEND}
  92.   if terminal_output gfxterm ; then true ; else
  93.     # For backward compatibility with versions of terminal.mod that don't
  94.     # understand terminal_output
  95.     terminal gfxterm
  96.   fi
  97. fi
  98. EOF
  99.   ;;
  100.   x)
  101.     # Just use the native terminal
  102.   ;;
  103.   x*)
  104.     cat << EOF
  105. if terminal_output ${GRUB_TERMINAL_OUTPUT} ; then true ; else
  106.   # For backward compatibility with versions of terminal.mod that don't
  107.   # understand terminal_output
  108.   terminal ${GRUB_TERMINAL_OUTPUT}
  109. fi
  110. EOF
  111.   ;;
  112. esac
  113.  
  114. cat << EOF
  115. if [ \${recordfail} = 1 ]; then
  116.   set timeout=-1
  117. else
  118.   set timeout=${GRUB_TIMEOUT}
  119. fi
  120. EOF
  121.